import logging

from config import BASE_HOST



class TenderApi:

    def __init__(self, ses):
        self.ses = ses
    # 获取session对象
    # 投资接口
    def tender(self,money_tz,id_tz=642):
        url = BASE_HOST + "/trust/trust/tender"
        body = {"id": id_tz, "depositCertificate": -1,
                "amount": money_tz}
        resp = self.ses.post(url,data = body)
        logging.info(f"投资接口的响应信息{resp.json()}")
        return resp

    # 第三方投资接口
    def third_tender(self,url,body):
        resp = self.ses.post(url,data=body)
        logging.info(f"第三方投资接口的响应信息{resp.json()}")
        return resp
